<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Generalized balanced ternary</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Generalized_balanced_ternary"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.math.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Generalized_balanced_ternary rootpage-Generalized_balanced_ternary skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Generalized balanced ternary</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><p><b>Generalized balanced ternary</b> is a generalization of the <a href="Balanced_ternary" title="Balanced ternary">balanced ternary</a> <a href="Numeral_system" title="Numeral system">numeral system</a> to represent points in a higher-dimensional <a href="Euclidean_space" title="Euclidean space">space</a>. It was first described in 1982 by Laurie Gibson and Dean Lucas.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> It has since been used for various applications, including geospatial<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> and high-performance scientific<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> computing.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="General_form">General form</h2></div>
<p>Like standard <a href="Positional_numeral_system" class="mw-redirect" title="Positional numeral system">positional numeral systems</a>, generalized balanced ternary represents a point <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle p}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>p</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle p}</annotation>
</semantics>
</math></span><img src="./81eac1e205430d1f40810df36a0edffdc367af36.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; margin-left: -0.089ex; width:1.259ex; height:2.009ex;" alt="{\displaystyle p}" loading="lazy"></span> as powers of a <b>base</b> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle B}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>B</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle B}</annotation>
</semantics>
</math></span><img src="./47136aad860d145f75f3eed3022df827cee94d7a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.764ex; height:2.176ex;" alt="{\displaystyle B}" loading="lazy"></span> multiplied by <b>digits</b> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d_{i}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle d_{i}}</annotation>
</semantics>
</math></span><img src="./abe3154db7d4f92fb42dd1f80f52f528c6312e4a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.009ex; height:2.509ex;" alt="{\displaystyle d_{i}}" loading="lazy"></span>.
</p><p><span class="mwe-math-element mwe-math-element-block"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"><math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle p=d_{0}+Bd_{1}+B^{2}d_{2}+\ldots }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>p</mi>
<mo>=</mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
<mo>+</mo>
<mi>B</mi>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
<mo>+</mo>
<msup>
<mi>B</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
<mo>+</mo>
<mo>…<!-- … --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle p=d_{0}+Bd_{1}+B^{2}d_{2}+\ldots }</annotation>
</semantics>
</math></span></span>
</p><p>Generalized balanced ternary uses a <a href="Transformation_matrix" title="Transformation matrix">transformation matrix</a> as its base <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle B}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>B</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle B}</annotation>
</semantics>
</math></span><img src="./47136aad860d145f75f3eed3022df827cee94d7a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.764ex; height:2.176ex;" alt="{\displaystyle B}" loading="lazy"></span>. Digits are <a href="Euclidean_vector" title="Euclidean vector">vectors</a> chosen from a finite subset <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \{D_{0}=0,D_{1},\ldots ,D_{n}\}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo fence="false" stretchy="false">{</mo>
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
<mo>=</mo>
<mn>0</mn>
<mo>,</mo>
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
<mo>,</mo>
<mo>…<!-- … --></mo>
<mo>,</mo>
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo fence="false" stretchy="false">}</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \{D_{0}=0,D_{1},\ldots ,D_{n}\}}</annotation>
</semantics>
</math></span><img src="./fd04e24b1101b37442ae5fc418959d108a0fe0e1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:21.898ex; height:2.843ex;" alt="{\displaystyle \{D_{0}=0,D_{1},\ldots ,D_{n}\}}" loading="lazy"></span> of the underlying space.
</p>
<div class="mw-heading mw-heading2"><h2 id="One_dimension">One dimension</h2></div>
<p>In one dimension, generalized balanced ternary is equivalent to standard balanced ternary, with three digits (0, 1, and −1). <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle B}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>B</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle B}</annotation>
</semantics>
</math></span><img src="./47136aad860d145f75f3eed3022df827cee94d7a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.764ex; height:2.176ex;" alt="{\displaystyle B}" loading="lazy"></span> is a <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 1\times 1}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mn>1</mn>
<mo>×<!-- × --></mo>
<mn>1</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 1\times 1}</annotation>
</semantics>
</math></span><img src="./2b4bf91a527dc01af9ef6ace81199becf1308e00.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:5.165ex; height:2.176ex;" alt="{\displaystyle 1\times 1}" loading="lazy"></span> matrix, and the digits <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle D_{i}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle D_{i}}</annotation>
</semantics>
</math></span><img src="./9f07b53d3212e08ca316a536c8aac0bbefa79ee1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.724ex; height:2.509ex;" alt="{\displaystyle D_{i}}" loading="lazy"></span> are length-1 vectors, so they appear here without the extra brackets.
</p><p><span class="mwe-math-element mwe-math-element-block"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"><math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{aligned}B&=3\\D_{0}&=0\\D_{1}&=1\\D_{2}&=-1\end{aligned}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true">
<mtr>
<mtd>
<mi>B</mi>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mn>3</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mn>0</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mn>1</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mo>−<!-- − --></mo>
<mn>1</mn>
</mtd>
</mtr>
</mtable>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\begin{aligned}B&=3\\D_{0}&=0\\D_{1}&=1\\D_{2}&=-1\end{aligned}}}</annotation>
</semantics>
</math></span></span>
</p>
<div class="mw-heading mw-heading3"><h3 id="Addition_table">Addition table</h3></div>
<p>This is the same addition table as standard balanced ternary, but with <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle D_{2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle D_{2}}</annotation>
</semantics>
</math></span><img src="./41b3839c40bd06e3dfea10798dfab41a905af256.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.979ex; height:2.509ex;" alt="{\displaystyle D_{2}}" loading="lazy"></span> replacing T. To make the table easier to read, the numeral <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle i}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>i</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle i}</annotation>
</semantics>
</math></span><img src="./add78d8608ad86e54951b8c8bd6c8d8416533d20.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:0.802ex; height:2.176ex;" alt="{\displaystyle i}" loading="lazy"></span> is written instead of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle D_{i}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle D_{i}}</annotation>
</semantics>
</math></span><img src="./9f07b53d3212e08ca316a536c8aac0bbefa79ee1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.724ex; height:2.509ex;" alt="{\displaystyle D_{i}}" loading="lazy"></span>.
</p>
<dl><dd><table class="wikitable" style="width: 8em; text-align: center;">
<caption>Addition
</caption>
<tbody><tr align="right">
<th>+</th>
<th>0</th>
<th>1</th>
<th>2
</th></tr>
<tr>
<th>0
</th>
<td>0</td>
<td>1</td>
<td>2
</td></tr>
<tr>
<th>1
</th>
<td>1</td>
<td>12</td>
<td>0
</td></tr>
<tr>
<th>2
</th>
<td>2</td>
<td>0</td>
<td>21
</td></tr></tbody></table></dd></dl>
<div class="mw-heading mw-heading2"><h2 id="Two_dimensions">Two dimensions</h2></div>
<p>In two dimensions, there are seven digits. The digits <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle D_{1},\ldots ,D_{6}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
<mo>,</mo>
<mo>…<!-- … --></mo>
<mo>,</mo>
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>6</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle D_{1},\ldots ,D_{6}}</annotation>
</semantics>
</math></span><img src="./9ce1d0b5974549972e34283c39871bd16a3e7985.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:11.135ex; height:2.509ex;" alt="{\displaystyle D_{1},\ldots ,D_{6}}" loading="lazy"></span> are six points arranged in a regular hexagon centered at <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle D_{0}=0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
<mo>=</mo>
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle D_{0}=0}</annotation>
</semantics>
</math></span><img src="./c5750885227336b961ffc397aaa4dd2af1063cfb.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:7.239ex; height:2.509ex;" alt="{\displaystyle D_{0}=0}" loading="lazy"></span>.<sup id="cite_ref-van_Roessel_4-0" class="reference"><a href="#cite_note-van_Roessel-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>
</p><p><span class="mwe-math-element mwe-math-element-block"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"><math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{aligned}B&={\frac {1}{2}}{\begin{bmatrix}5&{\sqrt {3}}\\-{\sqrt {3}}&5\end{bmatrix}}\\D_{0}&=0\\D_{1}&=\left(0,{\sqrt {3}}\right)\\D_{2}&=\left({\frac {3}{2}},-{\frac {\sqrt {3}}{2}}\right)\\D_{3}&=\left({\frac {3}{2}},{\frac {\sqrt {3}}{2}}\right)\\D_{4}&=\left(-{\frac {3}{2}},-{\frac {\sqrt {3}}{2}}\right)\\D_{5}&=\left(-{\frac {3}{2}},{\frac {\sqrt {3}}{2}}\right)\\D_{6}&=\left(0,-{\sqrt {3}}\right)\\\end{aligned}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true">
<mtr>
<mtd>
<mi>B</mi>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mn>1</mn>
<mn>2</mn>
</mfrac>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mrow>
<mo>[</mo>
<mtable rowspacing="4pt" columnspacing="1em">
<mtr>
<mtd>
<mn>5</mn>
</mtd>
<mtd>
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mn>3</mn>
</msqrt>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mn>3</mn>
</msqrt>
</mrow>
</mtd>
<mtd>
<mn>5</mn>
</mtd>
</mtr>
</mtable>
<mo>]</mo>
</mrow>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mn>0</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mrow>
<mo>(</mo>
<mrow>
<mn>0</mn>
<mo>,</mo>
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mn>3</mn>
</msqrt>
</mrow>
</mrow>
<mo>)</mo>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mrow>
<mo>(</mo>
<mrow>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mn>3</mn>
<mn>2</mn>
</mfrac>
</mrow>
<mo>,</mo>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<msqrt>
<mn>3</mn>
</msqrt>
<mn>2</mn>
</mfrac>
</mrow>
</mrow>
<mo>)</mo>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mrow>
<mo>(</mo>
<mrow>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mn>3</mn>
<mn>2</mn>
</mfrac>
</mrow>
<mo>,</mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<msqrt>
<mn>3</mn>
</msqrt>
<mn>2</mn>
</mfrac>
</mrow>
</mrow>
<mo>)</mo>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>4</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mrow>
<mo>(</mo>
<mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mn>3</mn>
<mn>2</mn>
</mfrac>
</mrow>
<mo>,</mo>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<msqrt>
<mn>3</mn>
</msqrt>
<mn>2</mn>
</mfrac>
</mrow>
</mrow>
<mo>)</mo>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>5</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mrow>
<mo>(</mo>
<mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mn>3</mn>
<mn>2</mn>
</mfrac>
</mrow>
<mo>,</mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<msqrt>
<mn>3</mn>
</msqrt>
<mn>2</mn>
</mfrac>
</mrow>
</mrow>
<mo>)</mo>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>6</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mrow>
<mo>(</mo>
<mrow>
<mn>0</mn>
<mo>,</mo>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mn>3</mn>
</msqrt>
</mrow>
</mrow>
<mo>)</mo>
</mrow>
</mtd>
</mtr>
</mtable>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\begin{aligned}B&={\frac {1}{2}}{\begin{bmatrix}5&{\sqrt {3}}\\-{\sqrt {3}}&5\end{bmatrix}}\\D_{0}&=0\\D_{1}&=\left(0,{\sqrt {3}}\right)\\D_{2}&=\left({\frac {3}{2}},-{\frac {\sqrt {3}}{2}}\right)\\D_{3}&=\left({\frac {3}{2}},{\frac {\sqrt {3}}{2}}\right)\\D_{4}&=\left(-{\frac {3}{2}},-{\frac {\sqrt {3}}{2}}\right)\\D_{5}&=\left(-{\frac {3}{2}},{\frac {\sqrt {3}}{2}}\right)\\D_{6}&=\left(0,-{\sqrt {3}}\right)\\\end{aligned}}}</annotation>
</semantics>
</math></span></span>
</p>
<div class="mw-heading mw-heading3"><h3 id="Addition_table_2">Addition table</h3></div>
<p>As in the one-dimensional addition table, the numeral <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle i}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>i</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle i}</annotation>
</semantics>
</math></span><img src="./add78d8608ad86e54951b8c8bd6c8d8416533d20.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:0.802ex; height:2.176ex;" alt="{\displaystyle i}" loading="lazy"></span> is written instead of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle D_{i}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle D_{i}}</annotation>
</semantics>
</math></span><img src="./9f07b53d3212e08ca316a536c8aac0bbefa79ee1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.724ex; height:2.509ex;" alt="{\displaystyle D_{i}}" loading="lazy"></span> (despite e.g. <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle D_{2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle D_{2}}</annotation>
</semantics>
</math></span><img src="./41b3839c40bd06e3dfea10798dfab41a905af256.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.979ex; height:2.509ex;" alt="{\displaystyle D_{2}}" loading="lazy"></span> having no particular relationship to the number 2).
</p>
<dl><dd><table class="wikitable" style="width: 8em; text-align: center;">
<caption>Addition<sup id="cite_ref-van_Roessel_4-1" class="reference"><a href="#cite_note-van_Roessel-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>
</caption>
<tbody><tr align="right">
<th>+</th>
<th>0</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
<th>5</th>
<th>6
</th></tr>
<tr>
<th>0
</th>
<td>0</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6
</td></tr>
<tr>
<th>1
</th>
<td>1</td>
<td>12</td>
<td>3</td>
<td>34</td>
<td>5</td>
<td>16</td>
<td>0
</td></tr>
<tr>
<th>2
</th>
<td>2</td>
<td>3</td>
<td>24</td>
<td>25</td>
<td>6</td>
<td>0</td>
<td>61
</td></tr>
<tr>
<th>3
</th>
<td>3</td>
<td>34</td>
<td>25</td>
<td>36</td>
<td>0</td>
<td>1</td>
<td>2
</td></tr>
<tr>
<th>4
</th>
<td>4</td>
<td>5</td>
<td>6</td>
<td>0</td>
<td>41</td>
<td>52</td>
<td>43
</td></tr>
<tr>
<th>5
</th>
<td>5</td>
<td>16</td>
<td>0</td>
<td>1</td>
<td>52</td>
<td>53</td>
<td>4
</td></tr>
<tr>
<th>6
</th>
<td>6</td>
<td>0</td>
<td>61</td>
<td>2</td>
<td>43</td>
<td>4</td>
<td>65
</td></tr></tbody></table></dd></dl>
<p>If there are two numerals in a cell, the left one is carried over to the next digit. Unlike standard addition, addition of two-dimensional generalized balanced ternary numbers may require multiple carries to be performed while computing a single digit.<sup id="cite_ref-van_Roessel_4-2" class="reference"><a href="#cite_note-van_Roessel-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Gosper_curve" title="Gosper curve">Gosper curve</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFGibsonLucas1982" class="citation journal cs1">Gibson, Laurie; Lucas, Dean (1982). "Spatial Data Processing Using Generalized Balanced Ternary". <i>Proceedings of the IEEE Computer Society Conference on Pattern Recognition and Image Processing</i>: <span class="nowrap">566–</span>571.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite id="CITEREFSahr2011" class="citation journal cs1">Sahr, Kevin (2011-01-01). <a rel="nofollow" class="external text" href="http://webpages.sou.edu/~sahrk/sqspc/pubs/sahrMMT11us.pdf">"Hexagonal Discrete Global Grid Systems for Geospatial Computing"</a> <span class="cs1-format">(PDF)</span>. <i>Archives of Photogrammetry, Cartography and Remote Sensing</i>. <b>22</b>: 363. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2011ArFKT..22..363S">2011ArFKT..22..363S</a>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite id="CITEREFde_KinderBarnes1997" class="citation journal cs1">de Kinder, R. E. Jr.; Barnes, J. R. (August 1997). "The Generalized Balanced Ternary (GBT) Applied to High-Performance Computational Algorithms". <i>APS Meeting Abstracts</i>. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/1997APS..CPC..C409D">1997APS..CPC..C409D</a>.</cite></span>
</li>
<li id="cite_note-van_Roessel-4"><span class="mw-cite-backlink">^ <a href="#cite_ref-van_Roessel_4-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-van_Roessel_4-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-van_Roessel_4-2"><sup><i><b>c</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFvan_Roessel1988" class="citation journal cs1">van Roessel, Jan W. (1988). <a rel="nofollow" class="external text" href="https://www.asprs.org/wp-content/uploads/pers/1988journal/nov/1988_nov_1565-1570.pdf">"Conversion of Cartesian coordinates from and to Generalized Balanced Ternary addresses"</a> <span class="cs1-format">(PDF)</span>. <i>Photogrammetric Engineering and Remote Sensing</i>. <b>54</b>: <span class="nowrap">1565–</span>1570.</cite></span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><a rel="nofollow" class="external text" href="http://paulbourke.net/geometry/tilingplane/">Spiral Honeycomb Mosaic</a>, another name for the two-dimensional form of this numbering system</li>
<li><a rel="nofollow" class="external text" href="https://groups.google.com/g/rec.games.roguelike.development/c/L4j_ETTFc2s">"Clever Hex Grid Method"</a> discussion on rec.games.roguelike.development</li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-05-05" href="https://en.wikipedia.org/wiki/?title=Generalized_balanced_ternary&oldid=1288994300">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>